1. Field of the Invention
The present invention relates to a control apparatus for vehicles. More specifically, the present invention relates to a control apparatus for vehicles which is capable of reducing greatly program development workload to enhance reusability of software even when hardware parts such as sensors, actuators, driving circuits and a microcomputer are changed, by providing a control program in layered form and adopting an object-oriented design method.
2. Related Art
A conventional control apparatus for vehicles has software or programs as shown in FIGS. 9A and 9B. The software of the control apparatus defines a sequence of programs along a flow of processing as shown in FIG. 9A, based on the intended processing such as fuel injection processing. Specifically, in a fuel injection control program for engine control, the program is constructed in the following manner, for instance, based on a sequence of processing for injecting fuel in a quantity most optimum to the present engine conditions.
That is, as shown in FIG. 9A, in a user program including an I/O program for controlling a CPU (hardware), a base routine is executed. In the base routine, a basic injection quantity is calculated to match the present operating condition based on parameters such as an engine rotation speed (basic injection quantity calculation), a basic energization time period for an injector driving circuit is calculated in correspondence with the basic injection quantity, an ineffective injection time period dependent on the hardware characteristics of the injector (fuel injection valve) is calculated (ineffective injection quantity calculation), and a final energization time period for the injector driving circuit is calculated (enrgization time period calculation) by adding the ineffective injection time period to the basic energization time period. Fuel injection is effected during the energization time period in an interrupt routine executed at every predetermined engine rotation position (crankshaft rotation position).
It is required in designing the sequence of programs to define in order the sequence of processing covering calculation of the basic injection quantity, addition of the ineffective injection period and execution of the injector energization, while taking into account the hardware characteristics of the microcomputer, sensors, injectors and the like. If the program is required to be changed partly, not only the corresponding program parts must be changed but also other program part must be checked and changed if necessary. As a result, the control program cannot be reused for other types of engines.
What is, when the basic injection quantity operation program is to be changed, the ineffective injection quantity operation program and the energization period operation program has to be checked and changed as well because the end of the program is not clear. Further, when the CPU has been changed, the entire user program has to be checked.
Thus, each time hardware is to be changed, it is required to define the sequence of program almost anew. Further, a programmer himself has to understand the program content of processing which is dependent on the hardware in addition to the control content and calculation method. As a result, the program development workload becomes enormous. This is described in further detail with respect to changing an injector, for instance, as the hardware.
An injector has an injection quantity characteristics shown in FIG. 10 in which the abscissa and the ordinate indicate the energization period T (ms) and the dynamic injection quantity (q), respectively. Here, the dynamic injection quantity means the injection quantity for a certain energization period, and a static injection quantity (Q) means the injection quantity injected for a unit time period when a needle valve is maintained at a maximum lift position under a specified pressure. Further, the ineffective injection period (Tva, Tvb) means a delay in time from the start of energizing the injector to the actual opening of the needle valve.
The injection quantity generally depends on the stroke of a needle valve, area of an injection hole, difference between injection point pressure and fuel pressure. Once those parameters are determined, the injection quantity depends on the opening period of the needle valve, that is, the energization period of the solenoid coil. Therefore, as shown in FIG. 10, the characteristics have linearity over a certain range of the energization period. Its inclination is indicated by the static injection quantity Q.
Provided that one injector a having characteristics a is changed to another injector b having characteristics b, the ineffective injection period changes from Tva to Tvb as shown. This results from variations in mechanical factors (that is, hardware characteristics) such as the stroke, injection hole and the like of injectors among the above parameters.
Thus, even when injector a is to be changed to injector b without any changes in the engine control apparatus (that is, even when no changes are made to the fuel injection quantity operation program), changes in the ineffective injection period are required to be compensated for in correspondence with the change of injectors. That is, it is required to check the entire operation program and change corresponding sections (in this instance, sections related to the ineffective injection period).
One solution for the above problem is proposed in JPA-7-277105, for instance. In this solution, as shown in FIG. 9B, an I/O program for processing input and output of a CPU (hardware) and a user program (operation program) for executing control calculation are provided separately to be independent from each other. Thus, the control software development workload is reduced by changing only the I/O program without changing operation program at the time of changing hardware.
According to this prior art, however, although the workload of developing the operation program section which is not required to be changed, the entire I/O program is required to be checked and the development workload still becomes enormous even if the change is only on a part of the driving circuit. This is because, the I/O program defines in sequence programs for the sensors, actuators, driving circuit and the like, even if the change is only on the part of the driving circuit (for instance, only on a motor driving circuit).
Each actual control apparatus for vehicles has a plurality of hardware (electronic component parts) such as a microcomputer, driving ICs for driving actuators, A/D converters as one of the input circuits, and the like. The life cycle of each hardware differs from one to another depending on its performance and cost. As a result, each time a new control apparatus for vehicles is developed, a change is required necessarily to be made on a part of hardware which constitutes the control apparatus. Thus, even in the proposed prior art improvement of FIG. 9B, a large program change is necessitated each time the control apparatus for vehicles is changed.
Further, in the above prior art, only a change to the CPU (hardware) of the control apparatus for vehicles is considered. Therefore, when actuators such as an injector and sensors such as a coolant temperature sensor are changed, the operation program is still required to be changed.